<div class="bf-unit">
  <!--确认弹窗-->
  <p-confirmDialog acceptLabel="确认" rejectLabel="取消"></p-confirmDialog>
  <!--消息提示-->
  <p-messages  [closable]="true" [style]="{'position':'fixed','left':'10vw','top': '0','margin-top': '0','width': '120vw','z-index':'9999'}"></p-messages>
  <!--顶部按钮-->
  <div class="bf-unit-header">
    <div class=" ui-g-4">
      <div class="ui-g-1 bf-unit-header-btn bf-unit-header-btn-add" (click)="unitinfoAddClick()">
        <img class="bf-unit-header-img-add" src="assets/images/ic_add.png" alt="">
        <span>增 加</span>
      </div>
      <div class="ui-g-1 bf-unit-header-btn bf-unit-header-btn-modify" (click)="unitinfoModifyClick()">
        <img class="bf-unit-header-img-modify" src="assets/images/ic_modify.png" alt="">
        <span>修 改</span>
      </div>
      <div class="ui-g-1 bf-unit-header-btn bf-unit-header-btn-delete" (click)="unitinfoDeleteClick()">
        <img class="bf-unit-header-img-delete" src="assets/images/ic_delete.png" alt="">
        <span>删 除</span>
      </div>
    </div>
    <!--搜索-->
    <div class="ui-inputgroup bf-unit-header-btn-search">
      <input type="text" pInputText placeholder="请输入地块号" #input>
      <span class="ui-inputgroup-addon" (click)="unitinfoSearchClick($event)"><i class="fa fa-search"></i></span>
    </div>
  </div>
  <!--表格-->
  <div class="bf-unit-table">
    <p-scrollPanel [style]="{width:'100%',height: '90%'}" styleClass="custombar">
      <p-table [columns]="unitinfoTableTitle" [value]="unitinfoTableContent"  [(selection)]="unitinfoSelect" (onRowSelect)="unitinfoonRowSelect($event)">
        <ng-template pTemplate="header" let-columns>
          <tr >
            <th style="width: 3em"  [ngStyle]="this.unitinfoTableTitleStyle">
              <p-tableHeaderCheckbox></p-tableHeaderCheckbox>
            </th>
            <th *ngFor="let col of columns"  [ngStyle]="this.unitinfoTableTitleStyle">
              {{col.header}}
            </th>
          </tr>
        </ng-template>
        <ng-template pTemplate="body" let-rowData let-columns="columns" let-rowIndex="rowIndex">
          <tr [pSelectableRow]="rowData"  *ngIf="rowIndex%2!=1" [ngStyle]="{'background':'#33353C','color':'#DEDEDE','text-align': 'center','height':'2vw'}">
            <td>
              <p-tableCheckbox [value]="rowData"></p-tableCheckbox>
            </td>
            <td  *ngFor="let col of columns" >
              {{rowData[col.field]}}
            </td>
          </tr>
          <tr [pSelectableRow]="rowData"  *ngIf="rowIndex%2!=0" [ngStyle]="{'background':'#2E3037','color':'#DEDEDE','text-align': 'center','height':'2vw'}">
            <td>
              <p-tableCheckbox [value]="rowData"></p-tableCheckbox>
            </td>
            <td  *ngFor="let col of columns" >
              {{rowData[col.field]}}
            </td>
          </tr>
        </ng-template>
      </p-table>
    </p-scrollPanel>

  </div>
  <!--增加弹窗-->
  <p-dialog header="信息添加" [(visible)]="unitinfoAddDialog" [width]="800">
    <!--Content-->
    <div class="ui-g ui-fluid" [ngStyle]="{'line-height':'3vh'}">
      <div class="ui-g-6">
        <div class="ui-g-4">
          <label for="addunitCode">单元编号：</label>
        </div>
        <div class="ui-g-8">
          <input id="addunitCode" type="text" pInputText placeholder="请输入单元编号" [(ngModel)]="unitinfoAdd.unitCode">
        </div>
      </div>
      <div class="ui-g-6">
        <div class="ui-g-4">
          <label for="addunitName">单元名称：</label>
        </div>
        <div class="ui-g-8">
          <input id="addunitName" type="text" pInputText placeholder="请输入单元名称" [(ngModel)]="unitinfoAdd.unitName">
        </div>
      </div>
      <div class="ui-g-6">
        <div class="ui-g-4">
          <label for="addbuildingId">楼宇ID：</label>
        </div>
        <div class="ui-g-8">
          <input id="addbuildingId" type="text" pInputText placeholder="请输入楼宇ID" [(ngModel)]="unitinfoAdd.buildingId">
        </div>
      </div>
    </div>
    <p-footer>
      <div class="ui-dialog-buttonpane ui-helper-clearfix">
        <button class="bf-unit-dialog-Btn bf-unit-dialog-Btn-sure" (click)="unitinfoAddSureClick()">确认</button>
        <button class="bf-unit-dialog-Btn bf-unit-dialog-Btn-false"  (click)="unitinfoAddDialog=false">取消</button>
      </div>
    </p-footer>
  </p-dialog>
  <!--修改弹窗-->
  <p-dialog header="信息修改" [(visible)]="unitinfoModifayDialog" [width]="800">
    <!--Content-->
    <div class="ui-g ui-fluid" [ngStyle]="{'line-height':'3vh'}">
      <div class="ui-g-6">
        <div class="ui-g-4">
          <label for="modifyunitCode">单元编号：</label>
        </div>
        <div class="ui-g-8">
          <input id="modifyunitCode" type="text" pInputText placeholder="请输入单元编号" [(ngModel)]="unitinfoModifay.unitCode">
        </div>
      </div>
      <div class="ui-g-6">
        <div class="ui-g-4">
          <label for="modifyunitName">单元名称：</label>
        </div>
        <div class="ui-g-8">
          <input id="modifyunitName" type="text" pInputText placeholder="请输入单元名称" [(ngModel)]="unitinfoModifay.unitName">
        </div>
      </div>
      <div class="ui-g-6">
        <div class="ui-g-4">
          <label for="modifybuildingId">楼宇ID：</label>
        </div>
        <div class="ui-g-8">
          <input  id="modifybuildingId" type="text" pInputText placeholder="请输入楼宇ID" [(ngModel)]="unitinfoModifay.buildingId">
        </div>
      </div>
    </div>
    <p-footer>
      <div class="ui-dialog-buttonpane ui-helper-clearfix">
        <button class="bf-unit-dialog-Btn bf-unit-dialog-Btn-sure" (click)="unitinfoModifySureClick()">确认</button>
        <button class="bf-unit-dialog-Btn bf-unit-dialog-Btn-false"  (click)="unitinfoModifayDialog=false">取消</button>
      </div>
    </p-footer>
  </p-dialog>
  <rbi-paging [option]="option"></rbi-paging>
</div>
